Index | Conventions

api/v1/quotes/{quoteno}/stock

Path: api/v1/quotes/{quoteno}/stock

This API is JSON:API compliant.

This endpoint supports the following methods:
GET POST PATCH DELETE

This endpoint requires an OAuth bearer token, and returns errors in a standard shape. See API Conventions for authentication, error responses and paging, which apply to every endpoint.

The resource type for this endpoint is QuoteStock
The identifier is quoteno-lineid

Relationships

A relationship links this QuoteStock to another resource. By default only the related resource's type and id are returned. Relationships marked Includable can be embedded in the response via the include query parameter (see Includes below). To set or change a relationship, send a resource identifier (type and id) for it. Postable means the relationship can be set when creating the resource (POST); Patchable means it can be changed when updating an existing resource (PATCH). Some relationships are Postable but not Patchable — they can be set at creation but not changed afterwards. A value sent for a relationship that is not Postable/Patchable in that context is not applied.

NotePostable and Patchable describe what the API surface accepts. Whether a particular change is permitted also depends on the resource's current state and your permissions, which Jim2 enforces — a change that is not allowed is rejected with an error response (see the Conventions page).
RelationshipTypeReturnsIncludablePostablePatchable
stockQuoteStockarray

Attributes

The QuoteStock resource type attributes are as follows:

AttributeTypeRead-onlyDescription
adddatestring (DateTime in ISO format)The date and time the stock line was added.
addinitstringThe initials of the user who added the stock line.
configNointegerStock attribute configuration number.
descriptionstringThe stock description. Only required if the default stock description needs to be overrridden. It is recommended this be set for special stock.
modifydatestring (DateTime in ISO format)The date and time the stock line was last modified.
modifyinitstringThe initials of the user who last modified the stock line.
qtynumberThe quantity ordered. Notes
Updating the Qty does NOT trigger a price recalculation using Jim2's pricing. If the caller needs to have Jim2 recalculate the price the stock line will have to be deleted and re-added.
When adding a stock post (POST), Jim2 will calculate pricing if no pricing is provided as part of the request
stockCodestringThe Jim2 stock code
stockIdintegerThe Jim2 stock number of the line's stock item.
unitstringThe unit of measure for the stock line.
unitPricenumberThe unit price. If Quote is calculating prices from tax paid amounts this will be tax inclusive, otherwise this will be tax exclusive.
It is highly recommended to set only one of unitPrice, unitPriceTF, or unitPriceTP - if multiple are set the last one processed wins.
unitPriceTFnumberThe unit price exlusive of tax. Note that if Quote is calculating prices from tax paid amounts the actual price set may differ due to rounding.
It is highly recommended to set only one of unitPrice, unitPriceTF, or unitPriceTP - if multiple are set the last one processed wins.
unitPriceTPnumberThe unit price inclusive of tax. Note that if Quote is calculating prices from tax exclusive amounts the actual price set may differ due to rounding.
It is highly recommended to set only one of unitPrice, unitPriceTF, or unitPriceTP - if multiple are set the last one processed wins.

Example GET (Return all)

Path: api/v1/quotes/10/stock

Response:

This example shows the maximum set of fields the endpoint can return, all populated. A real response only contains the data that applies to that record, so fields that are empty or not relevant are omitted — do not assume every field shown here will be present in every response.

This is a list. To keep the example readable, only the first item below is written out; the later items have been trimmed down in this documentation. In a real response each item comes back with the data applicable to that record (as described above).

Side-loading related resources with the include query parameter is not supported on list endpoints: an include parameter is ignored here and no included section is returned. To retrieve a related resource, request it directly using the id shown in each item's relationships, or use the single-resource (get by id) endpoint, which does support include.

{
    "data": [
        {
            "id": "10-1",
            "type": "QuoteStock",
            "attributes": {
                "qty": 1.0,
                "unitPrice": 1650.00,
                "unitPriceTF": 1500.00,
                "unitPriceTP": 1650.00,
                "configNo": 812,
                "addinit": "SYS",
                "adddate": "2024-06-24T14:04:00",
                "stockId": 7,
                "stockCode": "MULTILEVEL.MANF",
                "unit": "EACH",
                "description": "Multilevel Manufacture",
                "modifyinit": "SYS",
                "modifydate": "2024-06-24T14:04:19"
            },
            "relationships": {
                "stock": {
                    "data": {
                        "type": "QuoteStock",
                        "id": "7"
                    }
                }
            }
        },
        {
            "id": "10-2",
            "type": "QuoteStock",
            "attributes": {
                "stockCode": "SAMSUNG.MON.27",
                "description": "27\" QLED Samsung Monitor"
            }
        },
        {
            "id": "10-3",
            "type": "QuoteStock",
            "attributes": {
                "stockCode": "SAMSUNG.MON.27",
                "description": "27\" QLED Samsung Monitor"
            }
        }
    ]
}

Example GET (Return specific)

Path: api/v1/quotes/10/stock/10-1

Response:

This example shows the maximum set of fields the endpoint can return, all populated. A real response only contains the data that applies to that record, so fields that are empty or not relevant are omitted — do not assume every field shown here will be present in every response.

{
    "data": {
        "id": "10-1",
        "type": "QuoteStock",
        "attributes": {
            "qty": 1.0,
            "unitPrice": 1650.00,
            "unitPriceTF": 1500.00,
            "unitPriceTP": 1650.00,
            "configNo": 812,
            "addinit": "SYS",
            "adddate": "2024-06-24T14:04:00",
            "stockId": 7,
            "stockCode": "MULTILEVEL.MANF",
            "unit": "EACH",
            "description": "Multilevel Manufacture",
            "modifyinit": "SYS",
            "modifydate": "2024-06-24T14:04:19"
        },
        "relationships": {
            "stock": {
                "data": {
                    "type": "QuoteStock",
                    "id": "7"
                }
            }
        },
      "links": {
        "self": "/api/v1/quotes/10/stock/10-1"
      }
    }
}

Example POST

Path: api/v1/quotes/10/stock

Request:

{
    "data":
    {
        "type": "QuoteStock",
        "attributes":
        {
            "stockCode": "MOUSE",
            "qty": 2.0,
            "description": "Updated stock line description",
            "unitPriceTF": 120.00
        }
    }
}

Response:

This example shows the maximum set of fields the endpoint can return, all populated. A real response only contains the data that applies to that record, so fields that are empty or not relevant are omitted — do not assume every field shown here will be present in every response.

{
    "data": {
        "id": "10-4",
        "type": "QuoteStock",
        "attributes": {
            "qty": 2.0,
            "unitPrice": 49.50,
            "unitPriceTF": 45.00,
            "unitPriceTP": 49.50,
            "configNo": 815,
            "addinit": "API",
            "adddate": "2025-03-25T18:28:28.899892+11:00",
            "stockId": 5,
            "stockCode": "MOUSE",
            "unit": "EACH",
            "description": "Mouse",
            "modifyinit": "API",
            "modifydate": "2025-03-25T18:28:28.899892+11:00"
        },
        "relationships": {
            "stock": {
                "data": {
                    "type": "QuoteStock",
                    "id": "5"
                }
            }
        },
      "links": {
        "self": "/api/v1/quotes/10/stock/10-4"
      }
    }
}

Example PATCH

Path: api/v1/quotes/10/stock/10-1

Request:

{
    "data":
    {
        "id": "10-1",
        "type": "QuoteStock",
        "attributes":
        {
            "qty": 2.0,
            "description": "Updated stock line description",
            "unitPriceTF": 120.00
        }
    }
}

Response:

This example shows the maximum set of fields the endpoint can return, all populated. A real response only contains the data that applies to that record, so fields that are empty or not relevant are omitted — do not assume every field shown here will be present in every response.

{
    "data": {
        "id": "10-1",
        "type": "QuoteStock",
        "attributes": {
            "qty": 2.0,
            "unitPrice": 660.00,
            "unitPriceTF": 600.00,
            "unitPriceTP": 660.00,
            "configNo": 813,
            "addinit": "SYS",
            "adddate": "2024-08-23T11:43:00",
            "stockId": 1,
            "stockCode": "SAMSUNG.MON.27",
            "unit": "EACH",
            "description": "27\" QLED Samsung Monitor",
            "modifyinit": "API",
            "modifydate": "2025-03-25T18:26:16.8189395+11:00"
        },
        "relationships": {
            "stock": {
                "data": {
                    "type": "QuoteStock",
                    "id": "1"
                }
            }
        },
      "links": {
        "self": "/api/v1/quotes/10/stock/10-1"
      }
    }
}